package com.efast.cafe.portal.remote.company;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.efast.cafe.framework.exception.ServiceException;
import com.efast.cafe.framework.feign.constant.FeignConstant;
import com.efast.cafe.portal.bean.company.PortalCompanyUserBean;
import com.efast.cafe.portal.bean.company.PortalCompanyUserOrgBean;
import com.efast.cafe.portal.entity.company.PortalCompanyRole;
import com.efast.cafe.portal.entity.company.PortalCompanyUser;



/**
 * 企业用户管理服务
 * 
 * @author xuanming.feng
 * 
 */
@FeignClient(name = "cafe.portal-service",path="/cafe.portal-service")
public interface PortalCompanyUserService{

	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV+"/portal/company/userLogin",method=RequestMethod.POST)
	public PortalCompanyUser userDoLogin(@RequestParam("companyCode")String companyCode, @RequestParam("username")String username, @RequestParam("pwd")String pwd);
	
	/**
	    * @Title: queryUserAndOrgInfo
	    * @Description: 获取当前登录用户基本信息以及组织和职位信息
	    * @param @return    参数
	    * @return PortalCompanyUserOrgBean    返回类型
	    * @throws
	 */
	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV_AUTH+"/portal/company/queryUserAndOrgInfo",method=RequestMethod.POST)
	public PortalCompanyUserOrgBean queryUserAndOrgInfo();
	
	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV+"/portal/company/api_queryUserInfo",method=RequestMethod.POST)
	public PortalCompanyUserBean api_queryUserInfo(@RequestParam("companyCode")String companyCode, @RequestParam("username")String username);
	
	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV+"/portal/company/api_queryUserHasRoleList",method=RequestMethod.POST)
	public List<PortalCompanyRole> api_queryUserHasRoleList(@RequestParam("username")String username, @RequestParam("companyCode")String companyCode);


	/**
	 * @param companyCode
	 * 查询企业所有员工
	 * @return
	 */
	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV+"/portal/company/api_queryAllUserInfo",method=RequestMethod.POST)
	public List<PortalCompanyUser> api_queryAllUserInfo(@RequestParam("companyCode")String companyCode);
	
	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV+"/portal/company/api_userLogin",method=RequestMethod.POST)
	public PortalCompanyUser api_userLogin(@RequestParam("companyCode")String companyCode, @RequestParam("username")String username,  @RequestParam("pwd")String pwd);
}
